# Troubleshooting_Xcode

# Xcode Build error (1) Use of undeclared type 'AppSealingInterface'

You will gen an error message like above when you omit or miss-typed '#import "AppsealingiOS.h"' sentence in Bridging Header file.

Select "TestApp_Swift-Bridging-Header.h" and append '#import "AppsealingiOS.h"' at the end of document. Be sure that "AppsealingiOS.h" file exist in the designated folder (Xcode project/AppSealingSDK/Libraries/AppsealingiOS.h)

Also, the "AppsealingiOS.h" file must be included in your project with "AppsealingiOS.mm" file.

# Xcode Build error (2) Undefined symbols for architecture arm64: "_OBJC_CLASS_$_AppSealingInterface"

This linker error occurs when the "AppsealingiOS.mm" is not included in your project. Check project tree whether the file has added or not.

If the "AppsealingiOS.mm" file is not included in your project, perform "File > Add Files to "TestApp_Swift" ... " menu action.

# Xcode Build error (3) ld: library not found for -lStaticAppSec_Debug

This linker error occurs when the libStaticAppSec_Debug.a file is not exist in the designated folder or corrupted. The libStaticAppSec_Debug.a file should be exist in following path.

"TestApp_Swift (Project folder) > AppSealingSDK > Libraries > libStaticAppSec_Debug.a"

If the file is missing (or maybe corrupted) try to re-download or re-expand AppSealingSDK zip file.

This step is also applied to the linker error that says "ld: library not found for -lStaticAppSec" by just replacing "lStaticAppSec_Debug" to "lStaticAppSec". For Release builds, the file “libStaticAppSec.a” must exist in the correct location.

"TestApp_Swift (Project folder) > AppSealingSDK > Libraries > libStaticAppSec.a"

# Xcode Build error (4) Undefined symbols for architecture arm64: "ObjC_IsAbnormalEnvironmentDetected()", "Appsealing()"

This linker error occurs when the value of "Other Linker Flags" field within "Build Settings" configuration section is missing or invalid.

First, check "Build Settings" for "Other Linker Flags" field value.

Now, restore the "Other Linker Flags" settings by following steps.

  1. Clear the setting value : select "Other Linker Flags" row and press 'Delete' key.

  2. Expand "Other Linker Flags" by clicking the triangle icon left to "Other Linker Flags"

  1. Select "Debug" item and click to edit/insert value, then type in following text.

-lStaticAppSec_Debug -L$(PROJECT_DIR)/AppSealingSDK/Libraries

  1. Select "Release" item and click to edit/insert value, then type in following text.

-lStaticAppSec -L$(PROJECT_DIR)/AppSealingSDK/Libraries

# Xcode Build error (5) Undefined symbols for architecture arm64: "ObjC_IsAbnormalEnvironmentDetected()"  (Objective-C project only)

This linker error occurs when your project is Objective-C based and ViewController source code file has extension ".m". Just change the extension to ".mm".

# Execution error (I) App terminated immediately after launch

If your app has terminated right after launching in device, you should check the execution log message whether your bundle ID is valid.

If the log message contains string like " ==>> FAILED( Not registered bundle name )" then it tells the bundle Id you used is not registered properly at AppSealing Developer Center (ADC) while downloading AppSealing SDK file. Check your bundle Id if it is same as the value you entered when downloading SDK at ADC.

# Execution error (II) App terminated suddenly while running

If your app has terminated suddenly while running about after 20 seconds from launching you should check the execution log message whether you have run your app with Release configuration.

If the log message contains string like "Message from debugger: Terminated due to signal 14" then it tells that you have built & run your app in Release configuration and so AppSealing detection logic has activated. AppSealing logic in Release configuration checks some security intrusion such as jailbreak, debugger attachment, execution file encryption flag and if there is some problem it will close the app after 20 seconds irrespectively of user action or other circumstances.

Only in Release configuration the AppSealing logic will be activated and will terminate your app, so you should run your app with Debug configuration until you distribute the app to AppStore or TestFlight because the built executable file doesn't have encrypted with FairPlay DRM before it is installed from AppStore to device. AppSealing logic will detect that executable file has decrypted abnormally and it will terminate the app after 20 seconds while running your app in device at Xcode.

# Cannot execute “generate_hash” : Permission denied

It may happens that script execution in step 3-5 “Generate App integrity and certificate snapshot” fails by “Permission denied” error message like below.

In this situation run add permission command like below and try again.

$ chmod +x AppSealingSDK/Tools/generate_hash

# Using AppSealing SDK in Continuous Integration Tools

AppSealing SDK can be integrated naturally into CI (continues integration) tools such as "Buddy" or "Jenkins" etc. Once the AppSealing SDK has applied to your Xcode project, you can archive and export the project with command line shell script as usual.

Last Updated: 11/19/2024, 6:55:37 AM